package com.itheima.Service.Impl;

import com.itheima.Mapper.punishmentMapper;
import com.itheima.Pojo.Punishment;
import com.itheima.Service.PunishmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class punishmentServiceImpl implements PunishmentService {

    @Autowired
    private punishmentMapper punishmentmapper;


    @Override
    public List<Punishment> getAllPunishment() {
        return punishmentmapper.SelectAll();
    }

    @Override
    public void deleteById(Integer id) {
        punishmentmapper.deleteById(id);
    }

    @Override
    public void addPunishment(Punishment punishment) {
        punishmentmapper.addPunishment(punishment);
    }

    @Override
    public void updateById(Punishment punishment) {
        punishmentmapper.updateById(punishment);
    }
}
